worker_processes  1;

events {
    worker_connections  1024;
}

http {
    upstream flask_servers {
        server flask1:5000;
        server flask2:5000;
    }

    server {
        listen 80;
        server_name flask.itplaneta;

        location / {
            return 301 https://$host$request_uri;
        }
    }

    server {
        listen 443 ssl;
        server_name flask.itplaneta;

        ssl_certificate /etc/nginx/ssl/flask.crt;
        ssl_certificate_key /etc/nginx/ssl/flask.key;

        location / {
            proxy_pass http://flask_servers;
        }
    }
}
